java.lang.Objectorg.nlogo.workspace.ExtensionManager
public class ExtensionManager
| Constructor Summary | |
|---|---|
ExtensionManager(AbstractWorkspace workspace)
|
|
| Method Summary | |
|---|---|
void |
addToLibraryPath(Object classManager,
String directory)
|
boolean |
anyExtensionsLoaded()
Returns true if any extensions have been imported in the current model, false otherwise. |
void |
clearAll()
|
String |
dumpExtensionPrimitives()
Returns a String describing all the loaded extensions. |
String |
dumpExtensions()
Returns a String describing all the loaded extensions. |
void |
exportWorld(PrintWriter writer)
|
void |
finishFullCompilation()
Instructs any extensions which haven't been re-imported during the current compile to shut down. |
List<String> |
getExtensionNames()
|
File |
getFile(String path)
|
String |
getFullPath(String path)
|
List<String> |
getJarPaths()
|
String |
getSource(String filename)
|
void |
importExtension(String extName,
ErrorSource errors)
Loads the extension contained in the jar at jarPath. |
void |
importExtensionData(String name,
List<String[]> data,
ImportErrorHandler handler)
|
boolean |
isExtensionName(String name)
|
ExtensionObject |
readExtensionObject(String extName,
String typeName,
String value)
|
Object |
readFromString(String source)
|
Primitive |
replaceIdentifier(String name)
Returns the identifier "name" by its imported implementation, if any, or null, if not. |
void |
reset()
Instructs any loaded extensions to unload. |
String |
resolvePath(String path)
|
String |
resolvePathAsURL(String path)
|
Object |
retrieveObject()
Returns the stored object. |
void |
startFullCompilation()
During compilation, we reach the extensions [ ... ] block. |
void |
storeObject(Object obj)
Stores an object for the extension that can be retrieved in runOnce if the extension is loaded again. |
AbstractWorkspace |
workspace()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExtensionManager(AbstractWorkspace workspace)
| Method Detail |
|---|
public AbstractWorkspace workspace()
public boolean anyExtensionsLoaded()
ExtensionManager
anyExtensionsLoaded in interface ExtensionManager
public String getSource(String filename)
throws IOException
getSource in interface ExtensionManagerIOException
public File getFile(String path)
throws ExtensionException
getFile in interface ExtensionManagerExtensionExceptionpublic void storeObject(Object obj)
ExtensionManager
storeObject in interface ExtensionManagerobj - the object to be storedpublic Object retrieveObject()
ExtensionManager
retrieveObject in interface ExtensionManager
public void importExtension(String extName,
ErrorSource errors)
throws CompilerException
ExtensionManager
importExtension in interface ExtensionManagerextName - the path to the extension jar. May be relative to the
current model directory.errors - the ErrorSource to use when a CompilerException needs
to be thrown.
CompilerException
public void addToLibraryPath(Object classManager,
String directory)
addToLibraryPath in interface ExtensionManagerpublic String resolvePath(String path)
resolvePath in interface ExtensionManagerpublic String resolvePathAsURL(String path)
resolvePathAsURL in interface ExtensionManager
public String getFullPath(String path)
throws ExtensionException
ExtensionException
public Object readFromString(String source)
throws CompilerException
readFromString in interface ExtensionManagerCompilerExceptionpublic void clearAll()
public ExtensionObject readExtensionObject(String extName,
String typeName,
String value)
throws CompilerException
readExtensionObject in interface ExtensionManagerCompilerExceptionpublic Primitive replaceIdentifier(String name)
ExtensionManager
replaceIdentifier in interface ExtensionManagerpublic String dumpExtensions()
dumpExtensions in interface ExtensionManagerpublic List<String> getJarPaths()
getJarPaths in interface ExtensionManagerpublic List<String> getExtensionNames()
getExtensionNames in interface ExtensionManagerpublic String dumpExtensionPrimitives()
dumpExtensionPrimitives in interface ExtensionManagerpublic void reset()
ExtensionManager
reset in interface ExtensionManagerpublic void startFullCompilation()
ExtensionManager
startFullCompilation in interface ExtensionManagerpublic void finishFullCompilation()
ExtensionManager
finishFullCompilation in interface ExtensionManagerpublic void exportWorld(PrintWriter writer)
public void importExtensionData(String name,
List<String[]> data,
ImportErrorHandler handler)
throws ExtensionException
ExtensionExceptionpublic boolean isExtensionName(String name)